/**
  ******************************************************************************
  * @file    Icons.h
  * @author  Qilong Huang
  * @version V0.0.1
  * @date    05-03-2020
  * @brief   This file contains headers for led output function
  *          
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; KION(SZ) R&D Center
  *
  * Licensed under KION, (the "License");
  *
  ******************************************************************************
  */

#ifndef __ICONS_H_
#define __ICONS_H_

#include "stm32f10x.h"
#include "global.h"
#include "display.h"
#include "CAN_canopen.h"
#include "../gpio/gpio.h"
#include "hourmeter.h"

#define IC595_LATCH_PORT						  GPIOA
#define IC595LATCH_PIN							  GPIO_Pin_8
#define DIG_OUTPUT_PORTS                          GPIOC
#define CHIP_1_OUTPUT_EN_PIN                      GPIO_Pin_8
#define CHIP_1_CLK_PIN                            GPIO_Pin_9
#define CHIP_1_DATA_PIN                           GPIO_Pin_7
#define DIG_1_OUTPUTS_NUM                         8

/*led register, which bit is high, then the led will be turned on*/
/*Bit0 -- Reverse*/
/*Bit1 -- STOP*/
/*Bit2 -- BAT*/
/*Bit3 -- Tempurate*/
/*Bit4 -- Fix*/
/*Bit5 -- Reverse*/
/*Bit6 -- Reverse*/
/*Bit7 -- Driver Present*/
#define LED_STOP_ON				0x02
#define LED_BATTTARYLOW_ON		0x04
#define LED_TEMPURATEHIGH_ON	0x08
#define LED_FIX_ON				0x10
#define LED_DRIVERON_ON			0x80
#define REVERSE 				0x61


extern u32 icon_out_1;
extern U8 led_control;
void ICON_OUTOUT( u8 icon_no, u8 output );
void All_Led_On(void);
void All_Led_Off(void);
void write_sl595(u32 data);


#endif

